package api

import (
	"gitee.com/hust-ideas/little-genius-backend/model"
	"gitee.com/hust-ideas/little-genius-backend/service"
	"github.com/gin-gonic/gin"
)

// UserProfileGet - 获取用户信息
func UserProfileGet(c *gin.Context) {
	s := c.MustGet("service").(*service.ServiceContext)
	req := model.UserProfileGetReq{}
	req.Uid = c.MustGet("uid").(uint64)
	resp, err := s.UserProfileGet(req, c.Request.Context())
	if err != nil {
		c.JSON(500, gin.H{"error": err.Error()})
		return
	}
	c.JSON(200, resp)
}
